import request from '@/utils/request';
import qs from 'querystring';
import type { CSSProperties } from 'vue';
export type NoticeIconData = {
    avatar?: string;
    title?: string;
    description?: string;
    datetime?: string;
    extra?: string;
    style?: CSSProperties;
    key?: string | number;
    read?: boolean;
};
export type NoticeItem = {
    id: string;
    type: string;
    status: string;
} & NoticeIconData;
export async function queryNotices() {
    return request.get<any, NoticeItem[]>('/notices');
}
export async function changeNoticeReadState(notices: any[]): Promise<any> {
    return request.post('/change-notices-read', notices);
}
// 响应接口
export interface GetNoticePageRes {
    code: number;
    data: {
        total: number;
        records: {
            createTime: Record<string, unknown>;
            updateTime: Record<string, unknown>;
            creator: number;
            updater: number;
            // 公告ID */
            id: number;
            // 公告标题 */
            title: string;
            // 公告内容 */
            content: string;
            // 公告类型（1通知 2公告） */
            type: number;
            // 公告状态（0停用1正常） */
            status: number;
        }[];
        pages: number;
        current: number;
        size: number;
    };
    msg: string;
}
/**
 * 获得通知公告分页
 * @param {string} pageQuery 管理后台 - 通知公告分页 Request VO
 * @returns
 */
export function getNoticePage(pageQuery: object): Promise<GetNoticePageRes> {
    return request.get(`/system/notice/page?pageQuery=${pageQuery}`);
}
